home *** CD-ROM | disk | FTP | other *** search
File List | 1989-09-18 | 23.5 KB | 357 lines | [TEXT/MPS ] |
-
- MC680xx Assembler - Ver 3.1 18-Sep-89 Page 1
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- ;---------------------------------------------------------------------------------------
- ;
- ;File: ExROM1Fun.a
- ;Dev system: MPW 3.0
- ;By: MacDTS
- ;Date: 8/08/89
- ;
- ; This is a very small sample declaration ROM with the required board
- ; sResource and a functional sResource (which is blank).
- ; The board id and functional sResource types are especially bogus - your values
- ; must be obtained from MacDTS, after sending in the required information.
- ; Anyway, this file shows how to put together a ROM. You also need
- ; the Cards and Drivers book, with the source code for a ROM and driver.
- ; Both are stripped down versions of the Apple Macintosh Video card ROM and
- ; video driver aka the TFB board. There are also other examples and exploded
- ; drawings of declaration ROMs on the Developer Helper CD. Volume one is
- ; known as "Phil and Dave's Excellent CD". The examples, tools, and drawings are
- ; also on AppleLink. To get to them, go into (in order):
- ;
- ; Developer Services bulletin board icon
- ; Developer Technical Support folder
- ; Macintosh folder
- ; Tools folder
- ; Card Dev tools folder
- ;
- ;
- ; In the Card Dev Tools folder are other folders containing tools and
- ; libraries. These include:
- ;
- ; Examples folder - contains example declaration ROMs, video driver,
- ; source to a program like the GetsInfo program found
- ; in the Slot Tools folder
- ; Gamma Information folder - contains documention discussing gamma table format.
- ; This will be updated in later documentation for the
- ; new 32-bit QuickDraw. Eventually, the Cards and
- ; Drivers book will contain the new gamma information,
- ; NuBusTester folder - contains a library to detect new ROMs with fixed
- ; Slot Manager (Slot Manager that runs in 32-bit mode
- ; as opposed to 24-bit mode)
- ; Training Tools folder - contains MacDraw drawings of exploded
- ; configuration ROMs (like the existing Apple video
- ; card ROM and the Apple EtherNet board ROM.
- ;
- ; Slot tools folder - Inside, you'll find these tools:
- ;
- ; CRCPatch - MPW tool that calculates and patches in
- ; the crc value of the assembled Declaration ROM file.
- ;
- ; Data - MPW tool takes the assembled file and strips
- ; off the code 0 segment,leaving the code 1 segment
- ; (the raw code). The resulting file can then be
- ; downloaded to a rom burning machine.
- ;
- ; Tjscomm - A small terminal program that can be used
- ; to download the data file to a rom burning machine.
- ;
- ; SlotMgrTst - application that excersises the slot
- ; manager by making slot manager calls
- ;
- ; GetsInfo - application that displays sResources and
- ; other configuration ROM information
- ;
- ; Disclaimer: the above may be reorganized at any time, or changed via additions
- ; and deletions.
- ;
- ;
- ; The general structure of this example ROM is:
- ;
- ; [Format/Header]
- ; |
- ; |
- ; [sResource Directory]
- ; / \
- ; / \
-
- MC680xx Assembler - Ver 3.1 18-Sep-89 Page 2
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- ; / \
- ; / \
- ; [Board sResource] [Functional sResource]
- ; - Primary Init. - Driver Directory.
- ; - board id
- ; - Vendor Info.
- ;
- ;
- ; If you want to print this, I suggest using landscape mode!!!
- ;
- ;-------------------------------------------------------------------
-
- MACHINE MC68020
-
- ;=====================================================================
- ; Initial Assembler Directives
- ;=====================================================================
- PRINT ON
-
- ;
- ;=====================================================================
- ; BEGIN Declaration ROM
- ;=====================================================================
- 00000 SampleDeclROM MAIN
- 00000
- 00000
- 00000
- 00000 ;*************************************************************
- 00000 ; Constants
- 00000 ;*************************************************************
- 00000
- 00000 0000 1000 ROMSize EQU $1000 ;4K byte ROM in this example
- 00000 0000 ABCD TheBoardId EQU $ABCD ;the Board Id (DON'T USE
- 00000 ; THIS-GET from DTS!)
- 00000
- 00000 ;board sResource equates
- 00000 ;the following two lines are
- 00000 ;catBoard EQU 1 ;commented out since the equates
- 00000 ;TypeBoard EQU 0 ;are already defined in ROMEqu.a
- 00000 0000 0000 DrSwBoard EQU 0 ;NOT in ROMEqu.a, define it here
- 00000 0000 0000 DrHwBoard EQU 0 ;NOT in ROMEqu.a, define it here
- 00000
- 00000 0000 6666 CatExCat EQU $6666 ;Functional sResource sRsrc_Type
- 00000 0000 7777 TypExTyp EQU $7777 ;equates. THESE ARE EXAMPLES
- 00000 0000 8888 DrSwExSw EQU $8888 ;ONLY! DON'T USE THESE VALUES
- 00000 0000 9999 DrHwExHw EQU $9999 ;GET THEM FROM DTS!!
- 00000
- 00000 ;Example values-vendors
- 00000 ;should modify as needed
- 00000 0000 0000 defMinorBase EQU 0 ;RAM Offset is 0
- 00000 0004 0000 defMinorLength EQU $40000 ;RAM length is $40000
- 00000
- 00000 ;----------- sResource Directory ;<Id OF>
- 00000 0000 0001 sRsrcBoard EQU 1 ;Board sResource {May be any
- 00000 ;number in [0..127]}
- 00000 0000 0080 sRsrcFun EQU 128 ;functional sResource {May be
- 00000 ;any number in [128..254]}
- 00000
- 00000
- 00000 ;=====================================================================
- 00000 ; Directory
- 00000 ;=====================================================================
- 00000 _sRsrcDir OSLstEntry sRsrcBoard,_sRsrcBoard ;References board sResource.
- 00000 0100 000C 1 DC.L (sRsrcBoard<<24) ++ ((_sRsrcBoard-*) ** $00FFFFFF)
- 00004 1 ; DC.L (sRsrcBoard<<24)+(_sRsrcBoard AND $00FFFFFF)-*
- 00004 1 ; DC.L (sRsrcBoard<<24) + ((_sRsrcBoard AND $00FFFFFF)-*)
- 00004 OSLstEntry sRsrcFun,_sRsrcFun ;References functional sResource.
- 00004 8000 0078 1 DC.L (sRsrcFun<<24) ++ ((_sRsrcFun-*) ** $00FFFFFF)
- 00008 1 ; DC.L (sRsrcFun<<24)+(_sRsrcFun AND $00FFFFFF)-*
- 00008 1 ; DC.L (sRsrcFun<<24) + ((_sRsrcFun AND $00FFFFFF)-*)
- 00008 DatLstEntry endOfList,0 ;End of the list.
- 00008 FF00 0000 1 DC.L (endOfList<<24)+0
- 0000C
- 0000C
-
- MC680xx Assembler - Ver 3.1 18-Sep-89 Page 3
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- 0000C ;=============================================================
- 0000C ; The Board sResource
- 0000C ;=============================================================
- 0000C _sRsrcBoard OSLstEntry sRsrcType,_BoardType ;References Rsrc_Type entry
- 0000C 0100 0018 1 DC.L (sRsrcType<<24) ++ ((_BoardType-*) ** $00FFFFFF)
- 00010 1 ; DC.L (sRsrcType<<24)+(_BoardType AND $00FFFFFF)-*
- 00010 1 ; DC.L (sRsrcType<<24) + ((_BoardType AND $00FFFFFF)-*)
- 00010 OSLstEntry sRsrcName,_BoardName ;References Rsrc_Name entry
- 00010 0200 001C 1 DC.L (sRsrcName<<24) ++ ((_BoardName-*) ** $00FFFFFF)
- 00014 1 ; DC.L (sRsrcName<<24)+(_BoardName AND $00FFFFFF)-*
- 00014 1 ; DC.L (sRsrcName<<24) + ((_BoardName AND $00FFFFFF)-*)
- 00014 DatLstEntry boardId,TheBoardId ;boardId **ASSIGNED BY MACDTS**
- 00014 2000 ABCD 1 DC.L (boardId<<24)+TheBoardId
- 00018 OSLstEntry primaryInit,_sPInitRec ;References Primary init record.
- 00018 2200 002C 1 DC.L (primaryInit<<24) ++ ((_sPInitRec-*) ** $00FFFFFF)
- 0001C 1 ; DC.L (primaryInit<<24)+(_sPInitRec AND $00FFFFFF)-*
- 0001C 1 ; DC.L (primaryInit<<24) + ((_sPInitRec AND $00FFFFFF)-*)
- 0001C OSLstEntry vendorInfo,_VendorInfo ;References Vendor info list.
- 0001C 2400 002C 1 DC.L (vendorInfo<<24) ++ ((_VendorInfo-*) ** $00FFFFFF)
- 00020 1 ; DC.L (vendorInfo<<24)+(_VendorInfo AND $00FFFFFF)-*
- 00020 1 ; DC.L (vendorInfo<<24) + ((_VendorInfo AND $00FFFFFF)-*)
- 00020 DatLstEntry endOfList,0 ;End of the list.
- 00020 FF00 0000 1 DC.L (endOfList<<24)+0
- 00024
- 00024 ;Rsrc_Type IS ALWAYS THE SAME
- 00024 ;for the board sResource
- 00024 ;(but varies with different
- 00024 ;functional sResources)
- 00024 0001 _BoardType DC.W CatBoard ;ALWAYS $0001 for bd sResource
- 00026 0000 DC.W TypBoard ;ALWAYS $0000 for bd sResource
- 00028 0000 DC.W DrSwBoard ;ALWAYS $0000 for bd sResource
- 0002A 0000 DC.W DrHwBoard ;ALWAYS $0000 for bd sResource
- 0002C 4F464649434941 _BoardName DC.L 'OFFICIAL PRODUCT NAME' ;The name of the Board - should
- 00044 ;be official product name
- 00044
- 00044
- 00044 ;-------------------------------------------------------------
- 00044 ; Primary Init Record (if needed)
- 00044 ;-------------------------------------------------------------
- 00044 0000 0004 _sPInitRec DC.L _EndsPInitRec-_sPInitRec ;physical Block Size
- 00048 ; INCLUDE 'PrimaryInit.a' ;Primary Init Code
- 00048 0000 0048 _EndsPInitRec EQU * ;End of block
- 00048 STRING C ;Restore to 'c' string type.
- 00048
- 00048
- 00048 ;-------------------------------------------------------------
- 00048 ; Vendor Information record
- 00048 ;-------------------------------------------------------------
- 00048 ;** THE VENDOR INFO ENTRIES
- 00048 ;ARE DEFINED BY THE VENDOR, NOT
- 00048 ;BY MACDTS **
- 00048 _VendorInfo OSLstEntry VendorId,_VendorId ;References the Vendor Id.
- 00048 0100 0010 1 DC.L (VendorId<<24) ++ ((_VendorId-*) ** $00FFFFFF)
- 0004C 1 ; DC.L (VendorId<<24)+(_VendorId AND $00FFFFFF)-*
- 0004C 1 ; DC.L (VendorId<<24) + ((_VendorId AND $00FFFFFF)-*)
- 0004C OSLstEntry RevLevel,_RevLevel ;References the Revision Level.
- 0004C 0300 001C 1 DC.L (RevLevel<<24) ++ ((_RevLevel-*) ** $00FFFFFF)
- 00050 1 ; DC.L (RevLevel<<24)+(_RevLevel AND $00FFFFFF)-*
- 00050 1 ; DC.L (RevLevel<<24) + ((_RevLevel AND $00FFFFFF)-*)
- 00050 OSLstEntry PartNum,_PartNum ;References the Part Number.
- 00050 0400 0024 1 DC.L (PartNum<<24) ++ ((_PartNum-*) ** $00FFFFFF)
- 00054 1 ; DC.L (PartNum<<24)+(_PartNum AND $00FFFFFF)-*
- 00054 1 ; DC.L (PartNum<<24) + ((_PartNum AND $00FFFFFF)-*)
- 00054 DatLstEntry endOfList,0 ;End of the list.
- 00054 FF00 0000 1 DC.L (endOfList<<24)+0
- 00058
- 00058 434F4D50414E59 _VendorId DC.L 'COMPANY NAME' ;The Vendor Id. Most vendors use
- 00068 ;company name
- 00068 52656C65617365 _RevLevel DC.L 'Release-1.0' ;The Revision Level
- 00074 31322D33343536 _PartNum DC.L '12-3456' ;The Part Number
- 0007C
- 0007C
- 0007C ;=============================================================
- 0007C ; The Functional sResource
-
- MC680xx Assembler - Ver 3.1 18-Sep-89 Page 4
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- 0007C ;=============================================================
- 0007C _sRsrcFun OSLstEntry sRsrcType,_FunType ;References sRsrc_Type
- 0007C 0100 001C 1 DC.L (sRsrcType<<24) ++ ((_FunType-*) ** $00FFFFFF)
- 00080 1 ; DC.L (sRsrcType<<24)+(_FunType AND $00FFFFFF)-*
- 00080 1 ; DC.L (sRsrcType<<24) + ((_FunType AND $00FFFFFF)-*)
- 00080 OSLstEntry sRsrcName,_FunName ;References sRsrc_Name
- 00080 0200 0020 1 DC.L (sRsrcName<<24) ++ ((_FunName-*) ** $00FFFFFF)
- 00084 1 ; DC.L (sRsrcName<<24)+(_FunName AND $00FFFFFF)-*
- 00084 1 ; DC.L (sRsrcName<<24) + ((_FunName AND $00FFFFFF)-*)
- 00084 OSLstEntry sRsrcDrvrDir,_FunDrvrDir;References sResource driver dir
- 00084 0400 003C 1 DC.L (sRsrcDrvrDir<<24) ++ ((_FunDrvrDir-*) ** $00FFFFFF)
- 00088 1 ; DC.L (sRsrcDrvrDir<<24)+(_FunDrvrDir AND $00FFFFFF)-*
- 00088 1 ; DC.L (sRsrcDrvrDir<<24) + ((_FunDrvrDir AND $00FFFFFF)-*)
- 00088 DatLstEntry sRsrcHWDevId,1 ;The hardware device Id.
- 00088 0800 0001 1 DC.L (sRsrcHWDevId<<24)+1
- 0008C OSLstEntry MinorBaseOS,_MinorBase ;References Minor Base Offset.
- 0008C 0A00 002C 1 DC.L (MinorBaseOS<<24) ++ ((_MinorBase-*) ** $00FFFFFF)
- 00090 1 ; DC.L (MinorBaseOS<<24)+(_MinorBase AND $00FFFFFF)-*
- 00090 1 ; DC.L (MinorBaseOS<<24) + ((_MinorBase AND $00FFFFFF)-*)
- 00090 OSLstEntry MinorLength,_MinorLength;References Minor Base Length.
- 00090 0B00 002C 1 DC.L (MinorLength<<24) ++ ((_MinorLength-*) ** $00FFFFFF)
- 00094 1 ; DC.L (MinorLength<<24)+(_MinorLength AND $00FFFFFF)-*
- 00094 1 ; DC.L (MinorLength<<24) + ((_MinorLength AND $00FFFFFF)-*)
- 00094 DatLstEntry endOfList,0 ;End of the list.
- 00094 FF00 0000 1 DC.L (endOfList<<24)+0
- 00098
- 00098 ;sRsrc_Type labels for the
- 00098 ;Functional sResource; equates
- 00098 ;are assigned by MacDTS
- 00098 6666 _FunType DC.W CatExCat ;<Category>
- 0009A 7777 DC.W TypExTyp ;<Type>
- 0009C 8888 DC.W DrSwExSw ;<DrSw>
- 0009E 9999 DC.W DrHwExHw ;<DrHw>
- 000A0
- 000A0 45784361745F45 _FunName DC.L 'ExCat_ExType_ExSW_ExHW' ;Convention: _FunName (the
- 000B8 ;sRsrc_Name) is derived by using
- 000B8 ;_FunType above, but stripping
- 000B8 ;off the Cat, Typ, and DrSw/Hw
- 000B8 ;prefixes, then separating the
- 000B8 ;result by underscores. For
- 000B8 ;instance, the Macintosh II video
- 000B8 ;board has a functional sRsrc_Type
- 000B8 ;of CatDisplay, TypVideo,
- 000B8 ;DrSwApple, and DrHwTFB, so the
- 000B8 ;resulting sRsrc_Name is
- 000B8 ;Display_Video_Apple_TFB
- 000B8
- 000B8 0000 0000 _MinorBase DC.L defMinorBase ;RAM Offset
- 000BC 0004 0000 _MinorLength DC.L defMinorLength ;RAM length
- 000C0 ;Note: often these card-specific
- 000C0 ;equates are put in a separate
- 000C0 ;dependant equates file (Apple
- 000C0 ;puts the dependent equates for
- 000C0 ;the video card in the file
- 000C0 ;DepVidEqu.a for example). In
- 000C0 ;order to keep all the equates
- 000C0 ;for this example in one file, I
- 000C0 ;put them at the top of this
- 000C0 ;file. Note the values used
- 000C0 ;here are just for example
- 000C0 ;purposes.
- 000C0
- 000C0
- 000C0 ;-------------------------------------------------------------
- 000C0 ; Driver directory (if there's an on-board driver)
- 000C0 ;-------------------------------------------------------------
- 000C0 _FunDrvrDir OSLstEntry sMacOS68020,_sMacOS68020;References Macintosh-OS
- 000C0 0200 0008 1 DC.L (sMacOS68020<<24) ++ ((_sMacOS68020-*) ** $00FFFFFF)
- 000C4 1 ; DC.L (sMacOS68020<<24)+(_sMacOS68020 AND $00FFFFFF)-*
- 000C4 1 ; DC.L (sMacOS68020<<24) + ((_sMacOS68020 AND $00FFFFFF)-*)
- 000C4 ;68020 driver.
- 000C4 DatLstEntry endOfList,0 ;End of the list.
- 000C4 FF00 0000 1 DC.L (endOfList<<24)+0
- 000C8
-
- MC680xx Assembler - Ver 3.1 18-Sep-89 Page 5
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- 000C8
- 000C8 ;Driver-1 (68020).
- 000C8 0000 0004 _sMacOS68020 DC.L _End020Drvr-_sMacOS68020 ;The physical Block Size
- 000CC ; INCLUDE 'NameofDrvrSrcCodeFile.a' ;The driver code
- 000CC 0000 00CC _End020Drvr EQU * ;The end of the driver.
- 000CC STRING C
- 000CC
- 000CC
- 000CC
- 000CC
- 000CC 0000 0FEC ORG ROMSize-FHeaderRec.fhBlockSize
- 00FEC ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00FEC ; Format/Header Block
- 00FEC ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00FEC 00FF F014 DC.L (_sRsrcDir-*)**$00FFFFFF ;Offset to sResource directory
- 00FF0 0000 1000 DC.L ROMSize ;Length of declaration data
- 00FF4 0000 0000 DC.L 0 ;CRC-can be patched by MPW crc tool
- 00FF8 01 DC.B romRevision ;Revision level
- 00FF9 01 DC.B AppleFormat ;Format
- 00FFA 5A93 2BC7 DC.L TestPattern ;Test pattern
- 00FFE 00 DC.B 0 ;Reserved byte (must be zero)
- 00FFF E1 DC.B $E1 ;ByteLanes: 1110 0001 (bytelane 0)
- 01000
- 01000 ENDP
-
- END
-
- Elapsed time: 10.61 seconds.
-
- Assembly complete - no errors found. 3815 lines.
-